{php include wl_template('common/header');}
<ul class="nav nav-tabs">
	<li><a href="{php echo web_url('halfcard/realcard/cardlist');}">所有实体卡</a></li>
	<li class="active"><a href="{php echo web_url('halfcard/realcard/addcard');}">生成实体卡</a></li>
</ul>
<div class="app-content">
	<div class="app-form">
		<form class="form-horizontal form" action="" method="post" id="form1">
			<div class="panel panel-default">
				<div class="panel-heading">
					生成实体卡
				</div>
				<div class="panel-body">
					<div class="form-group">
						<label class="col-sm-2 control-label">实体卡时长</label>
						<div class="col-sm-5 col-xs-12">
							<div class="input-group">
								<input type="text" name="days" class="form-control"/>
								<span class="input-group-addon">天</span>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">生成数量</label>
						<div class="col-sm-5 col-xs-12">
							<input type="text" class="form-control" placeholder="" name="qr_num" />
							<span class="help-block">单次生成数量最大为1万个</span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">所属代理</label>
						<div class="col-md-5">
							<select name="aid" style="width: 100%;">
								<option value="0" >总后台</option>
								{loop $agentlist $agent}
								<option value="{$agent['id']}">{$agent['agentname']}</option>
								{/loop}
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">匹配等级</label>
						<div class="col-md-5">
							<select name="levelid" style="width: 100%;">
								<option value="0" >{$_W['wlsetting']['halflevel']['name']}</option>
								{loop $levels $level}
								<option value="{$level['id']}">{$level['name']}</option>
								{/loop}
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">场景备注</label>
						<div class="col-sm-5 col-xs-12">
							<input type="text" class="form-control" placeholder="" name="remark" />
							<span class="help-block">用于区分实体卡不同场景或不同所属</span>
						</div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-9">
					<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" />
					<input type="hidden" name="token" value="{$_W['token']}" />
				</div>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
	$("#form1").submit(function(){
		if($(":text[name='qr_num']").val() == '') {
			layer.alert('请填写实体卡生成数量！', {icon: 5});
			return false;
		}
		if($(":text[name='remark']").val() == '') {
			layer.alert('请填写场景备注！', {icon: 5});
			return false;
		}
		if($(":text[name='qr_num']").val() <= 0) {
			layer.alert('实体卡生成数量必须大于0！', {icon: 5});
			return false;
		}
		if($(":text[name='qr_num']").val() > 10000) {
			layer.alert('实体卡单次生成数量最大1万个！', {icon: 5});
			return false;
		}
	});
</script>
{php include wl_template('common/footer');}